/**
 * 
 */
package jmath.eval.data;

import java.util.*;
import java.io.*;
import java.net.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * @author timon
 * 
 */
public class JavaToScriptUserObjectsCollection {

	private Log log = LogFactory
			.getLog(JavaToScriptUserObjectsCollection.class);

	private Map<String, Object> javaToScriptUserObjects;

	public JavaToScriptUserObjectsCollection() {

	}

//	public JavaToScriptUserObjectsCollection(String path) {
//		File folder = new File(path);
//		if (folder.exists()) {
//			if (folder.isFile() && folder.canRead()
//					&& folder.getName().endsWith(".jar")) {
//				try {
//					URL[] urls = { new URL(path) };
//					Thread.currentThread().setContextClassLoader(
//							new URLClassLoader(urls, Thread.currentThread()
//									.getContextClassLoader()));
//				} catch (Exception ex) {
//					log.error(ex.getMessage());
//				}
//			} else {
//				List<URL> urlList = new ArrayList<URL>();
//				for (File file : folder.listFiles()) {
//					if (file.isFile() && file.canRead()
//							&& file.getName().endsWith(".jar")) {
//						try {
//							urlList.add(new URL(path));
//						} catch (Exception ex) {
//							log.error(ex.getMessage());
//						}
//					}
//				}
//				Thread.currentThread().setContextClassLoader(
//						new URLClassLoader((URL[]) urlList.toArray(), Thread
//								.currentThread().getContextClassLoader()));
//			}
//		}
//	}

	public Map<String, Object> getJavaToScriptUserObjects() {
		return javaToScriptUserObjects;
	}

	public void setJavaToScriptUserObjects(
			Map<String, Object> javaToScriptUserObjects) {
		this.javaToScriptUserObjects = javaToScriptUserObjects;
	}
}
